package com.bnz.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student implements Serializable {
    @TableId(type = IdType.ASSIGN_ID)       //使用雪花算法生成的id
    private String sid;
    private String sname;
    private String sex;
    private Integer age;
    private String addr;
    private Integer cid;

    @TableField(fill = FieldFill.INSERT)            //添加学生时间
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)     //修改学生时间
    private LocalDateTime updateTime;

    @TableLogic
    private Integer deleted;                //逻辑删除字段

    @TableField(exist = false)              //表示该字段不在这个表里
    private String cname;

    public Student(String sname, String sex, Integer age, String addr, Integer cid) {
        this.sname = sname;
        this.sex = sex;
        this.age = age;
        this.addr = addr;
        this.cid = cid;
    }
}
